<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>商品详情</title>
    <link href="css/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="css/aui.css"/>
    <link rel="stylesheet" href="css/shop.css">
    <link rel="stylesheet" href="css/alert.css">
    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/mui.min.js"></script>
    <script>
        var autoload=function () {
            var data={};
            data.user_id=user_id;
            data.userpwd=userpwd;
            data.id=getQueryString("id")
            if(user_id==""){
                return;
            }
            $.ajax({
                type: "POST",
                //url: "http://test/jsonp.php",
                data: data,
                url: "http://xjh.taoleyizhan.com/wap/index.php?ctl=shopdetail&act=index",
                dataType: "json",
                success: function (json) {
                    console.log(json)
                    page_data = json

                    $('#goodsname').html(page_data.goods_info.name)
                    $('#newprice').html(page_data.goods_info.current_price-page_data.ticket_info.origin_price)
                    $('#oldprice').html(page_data.goods_info.current_price)
                    $('#quanname').html(page_data.ticket_info.name);
                    $('#buy').attr('data-id',page_data.goods_info.id)
                    $('#getquan').attr('data-id',page_data.goods_info.id)
                    InitChat();

                },
                error: function (json) {
                    console.log(json);
                }
            })
        }
    </script>
    <script src="js/init.js"></script>
</head>
<body>
    <header class="mui-bar mui-bar-nav">
        <a href="javascript:history.go(-1)" class="mui-icon-undo mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title" >商品详情</h1>
    </header>

    <div class="mui-content aui-pad-15 f14">
        <div class="aui-pad-t-10 aui-pad-b-10"><img class="aui-col-10" src="image/banner.png" alt=""></div>
        <div class="aui-border-b-gray aui-pad-b-5 re">
            <div><b id="goodsname"></b></div>
            <div>券后价￥ <span class="aui-color-red" id="newprice">100</span> <span class="f10">商品原价：<b id="oldprice">？</b>元</span></div>
            <div class="ab aui-background-yellow aui-col-2 aui-border-radius-30 mui-text-center" style="bottom:5px;right:0;">
                <a id="getquan" data-id="">领 券</a>
            </div>
        </div>
        <div class="f10 aui-color-red aui-pad-t-10 line-height-1"><span id="quanname"></span></b> <br/>所有活动商品与苹果公司（apple inc.）无关</div>
        <ul class="line-height-2">

            <li>商品详情</li>
        </ul>
        <div id="goodsdescription"></div>
    </div>
    <div class="fix aui-col-10 aui-pad-10 aui-background-yellow mui-text-center f14" style="left:0;bottom:0;">
        <a class="block" id="buy" data-id="">立即参与</a>
    </div>
</body>
<script src="js/alert.js"></script>
<script>
    $('#buy').click(function () {
        var goods_id=$(this).attr('data-id')
        if(!goods_id>1){
            alert('请稍后再试！')
            return;
        }
        var url="quan_dingdan2.html?id="+goods_id;
        window.location.href=url;
    })
    $('#getquan').click(function () {
        var ticket_id=$(this).attr('data-id')
        if(!ticket_id>1){
            alert('请稍后再试！')
            return;
        }
        var url="quan_dingdan1.html?id="+ticket_id;
        window.location.href=url;
    })
</script>
</html>